/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package actioncombination.common.value;

import actioncombination.common.datastructure.Pair;

/**
 *
 * @author Administrador
 */
public class Point2DIntegerValue extends Value<Pair<Integer, Integer>> {
	private int x, y;

	private String string;

	public Point2DIntegerValue(int x, int y) {
		this.x = x;
		this.y = y;
		string = "<" + x + ", " + y + ">";
	}

	@Override
	public String toString() {
		return string;
	}

	public int getX() {
		return x;
	}

	public int getY() {
		return y;
	}

	@Override
	public boolean equals(Object object) {
		if (object instanceof Point2DIntegerValue) {
			return string.equals(object.toString());
		}
		return false;
	}

	@Override
	public int hashCode() {
		return string.hashCode();
	}

    public void setX(int x) {
        this.x = x;
    }

    public void setY(int y) {
        this.y = y;
    }

    public Pair<Integer, Integer> getValue() {
        return new Pair<Integer, Integer>(this.getX(), this.getY());
    }

    public int compareTo(Pair<Integer, Integer> o) {
        //CHOCHO
        return o.getFirst().compareTo(o.getSecond());
    }

}

